Skip to content

Instantly share code, notes, and snippets.

Advanced Git

Git foundations

Data storage

  • Git is like a key-value store
    • key = data
    • value = hash of the data
  • The key (SHA1)
@Pythonation
Pythonation / prompt.md
Last active September 26, 2026 11:46
3 PROMPTS OF CODING AGENTS

1. برومبت التخطيط المطوّر (The Planning Protocol)

[الدور والمسؤولية] أنت الآن تعمل بصفة Staff Software Engineer ومدير تقني Tech Lead. مهمتك التخطيط المعماري الصارم للمشروع التالي: [أدخل وصف المشروع هنا]

[قواعد ما قبل التتخطيط] قبل البدء بالبروتوكولات، يجب أن تطبق مبدأ "Think Before Coding":

@Zekfad
Zekfad / conventional-commits.md
Last active September 26, 2026 11:45
Conventional Commits Cheatsheet

Quick examples

  • feat: new feature
  • fix(scope): bug in scope
  • feat!: breaking change / feat(scope)!: rework API
  • chore(deps): update dependencies

Commit types

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Changes which doesn't change source code or tests e.g. changes to the build process, auxiliary tools, libraries
@icqparty
icqparty / WGET website download
Created May 23, 2014 18:41
Cкачивание сайта целиком с помощью wget
Чтобы скачать сайт целиком с помощью wget нужно выполнить команду:
wget -r -k -l 7 -p -E -nc http://site.com/
После выполнения данной команды в директорию site.com будет загружена локальная копия сайта http://site.com. Чтобы открыть главную страницу сайта нужно открыть файл index.html.
Рассмотрим используемые параметры:
-r — указывает на то, что нужно рекурсивно переходить по ссылкам на сайте, чтобы скачивать страницы.
-k — используется для того, чтобы wget преобразовал все ссылки в скаченных файлах таким образом, чтобы по ним можно было переходить на локальном компьютере (в автономном режиме).
-p — указывает на то, что нужно загрузить все файлы, которые требуются для отображения страниц (изображения, css и т.д.).
-l — определяет максимальную глубину вложенности страниц, которые wget должен скачать (по умолчанию значение равно 5, в примере мы установили 7). В большинстве случаев сайты имеют страницы с большой степенью вложенности и wget может просто «закопаться», скачивая новые страницы. Чтобы этого не п
@karpathy
karpathy / microgpt.py
Last active September 26, 2026 11:32
microgpt
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
export class Mutex {
#lock = Promise.resolve();
async lock() {
let release = () => {};
const lock = this.#lock;
this.#lock = new Promise((resolve) => {
release = resolve;
});
await lock;
{
"input": {
"blocklist": [],
"compressor#0": {
"attack": 15.0,
"boost-amount": 0.0,
"boost-threshold": -72.0,
"bypass": false,
"dry": -80.01,
"hpf-frequency": 10.0,
@zerofltexx
zerofltexx / cachyos-limine-luks-tpm-auto-unlock.md
Created November 19, 2025 13:53
Limine + LUKS2 + TPM2 Auto-Unlock Guide (CachyOS/Arch Linux)

Limine + LUKS2 + TPM2 Auto-Unlock Guide (CachyOS/Arch Linux)

Working configuration for:

  • Limine bootloader
  • LUKS2 encrypted root partition
  • btrfs with Snapper snapshots
  • dracut (required for btrfs snapshot boot)
  • systemd-based initramfs
  • Secure Boot enabled
  • TPM2 auto-unlock using PCR 0+7
@ianrodrigues
ianrodrigues / phpstan.neon
Created September 26, 2026 11:07
PHPStan leveraging `spaze/phpstan-disallowed-calls`
includes:
- vendor/larastan/larastan/extension.neon
- vendor/nesbot/carbon/extension.neon
- vendor/spaze/phpstan-disallowed-calls/extension.neon
parameters:
phpVersion: 80500
checkAuthCallsWhenInRequestScope: true
checkConfigTypes: true
parseModelCastsMethod: true
# this file contains keys needed for decryption of file system data (WUD/WUX)
# 1 key per line, any text after a '#' character is considered a comment
# the emulator will automatically pick the right key
541b9889519b27d363cd21604b97c67a # example key (can be deleted)
d7b00402659ba2abd2cb0db27fa2b656 # Common
805e6285cd487de0faffaa65a6985e17 # Espresso Ancast
b5d8ab06ed7f6cfc529f2ce1b4ea32fd # Starbuck Ancast
9a164ee15ac7ceb64d3cc130094095f6 # 007 Legends [EUR, NUS]